From 5be14577d6e2fc5ba0d564d15619ceecbd456a1a Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Tue, 28 Jan 2020 23:47:16 +0900 Subject: [PATCH] imwayland: Connect gtk_im_context_focus_in/out to GtkEventControllerKey GtkEventControllerKey can handle GDK_FOCUS_CHANGE and call gtk_im_context_focus_in/out directly. https://gitlab.gnome.org/GNOME/gtk/issues/2390 --- gtk/gtkeventcontrollerkey.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtkeventcontrollerkey.c b/gtk/gtkeventcontrollerkey.c index 07c8b8150c..db7acbc8fd 100644 --- a/gtk/gtkeventcontrollerkey.c +++ b/gtk/gtkeventcontrollerkey.c @@ -129,6 +129,13 @@ update_focus (GtkEventControllerKey *key, { key->is_focus = is_focus; g_object_notify (G_OBJECT (key), "is-focus"); + if (key->im_context) + { + if (focus_in) + gtk_im_context_focus_in (key->im_context); + else + gtk_im_context_focus_out (key->im_context); + } } if (key->contains_focus != contains_focus) { -- 2.30.2